<?php
class recommendAction extends rareAction{
	public function execute(){}
	public function executePost(){
		$id = $this->getPostParam('id',0);
		if($id==0) jsonReturn(0,'参数错误');
		$dao = new DaoProduct();
		$product = $dao->getOne(" id='{$id}'");
		if(!empty($product)){
			$isIndex = $product['isIndex']?0:1;
			$dao->update(" id='{$id}'",array('isIndex'=>$isIndex));
			jsonReturn(1,$isIndex);
		}
		jsonReturn(0,'失败');
	}
}
?>
